package tool

import play.api.data.FormBinding
import play.api.http.HttpVerbs
import play.api.mvc.AnyContent
import tool.Pojo.MissionIdData
import shared.Pojo.{AllPlotData, IsFilterData, SForm}
import upickle.default._
import implicits.Implicits._

/**
 * Created by yz on 16/6/2021
 */
object SFormTool {

  def getAllPlotData(implicit request: play.api.mvc.Request[AnyContent], formBinding: FormBinding) = {
    val value = Tool.transformRq
    val finalObj = value.toObj ++ ujson.Obj("layout" -> value, "color" -> value, "font" -> value, "corNetwork" -> value)
    val data = finalObj.transform(reader[AllPlotData])
    data
  }

  def getIsFilterData(implicit request: play.api.mvc.Request[AnyContent], formBinding: FormBinding) = {
    val data = Tool.transformRq.transform(reader[IsFilterData])
    data
  }


}
